package view;

import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import java.awt.Point;
import java.awt.Font;
import java.awt.Color;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.JTextField;

public class addcriminalstatus extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JLabel lbIcon = null;
	private JPanel jPanel = null;
	private JLabel lbComplaint = null;
	private JButton btnOK = null;
	private JButton btnCancel = null;
	private JLabel lbName = null;
	private JTextField txtName = null;

	public addcriminalstatus() {
		super();
		initialize();
	}

	private void initialize() {
		this.setSize(450, 264);
		this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/image/criminalTpye.png")));
		this.setName("addCriminalStatus");
		this.setResizable(false);
		this.setContentPane(getJContentPane());
		this.setTitle("Add Criminal Status");
	}

	private JPanel getJContentPane() {
		if (jContentPane == null) {
			lbName = new JLabel();
			lbName.setBounds(new Rectangle(105, 105, 78, 27));
			lbName.setText("Status name:");
			lbIcon = new JLabel();
			lbIcon.setBounds(new Rectangle(43, 19, 44, 42));
			lbIcon.setIcon(new ImageIcon(getClass().getResource("/image/criminal.png")));
			lbIcon.setText("");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(lbIcon, null);
			jContentPane.add(getJPanel(), null);
			jContentPane.add(getBtnOK(), null);
			jContentPane.add(getBtnCancel(), null);
			jContentPane.add(lbName, null);
			jContentPane.add(getTxtName(), null);
		}
		return jContentPane;
	}

	private JPanel getJPanel() {
		if (jPanel == null) {
			lbComplaint = new JLabel();
			lbComplaint.setLocation(new Point(0, 4));
			lbComplaint.setFont(new Font("Dialog", Font.BOLD, 18));
			lbComplaint.setForeground(new Color(8, 66, 36));
			lbComplaint.setText("Add Criminal Status");
			lbComplaint.setSize(new Dimension(176, 28));
			jPanel = new JPanel();
			jPanel.setLayout(null);
			jPanel.setBounds(new Rectangle(106, 29, 175, 31));
			jPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 0, Color.red));
			jPanel.add(lbComplaint, null);
		}
		return jPanel;
	}

	private JButton getBtnOK() {
		if (btnOK == null) {
			btnOK = new JButton();
			btnOK.setHorizontalTextPosition(SwingConstants.RIGHT);
			btnOK.setIcon(new ImageIcon(getClass().getResource("/image/OK.png")));
			btnOK.setText("OK");
			btnOK.setLocation(new Point(329, 196));
			btnOK.setSize(new Dimension(82, 28));
			btnOK.setHorizontalAlignment(SwingConstants.LEFT);
		}
		return btnOK;
	}

	private JButton getBtnCancel() {
		if (btnCancel == null) {
			btnCancel = new JButton();
			btnCancel.setHorizontalTextPosition(SwingConstants.RIGHT);
			btnCancel.setIcon(new ImageIcon(getClass().getResource("/image/Close.png")));
			btnCancel.setText("Exit");
			btnCancel.setLocation(new Point(233, 196));
			btnCancel.setSize(new Dimension(84, 28));
			btnCancel.setHorizontalAlignment(SwingConstants.LEFT);
		}
		return btnCancel;
	}

	private JTextField getTxtName() {
		if (txtName == null) {
			txtName = new JTextField();
			txtName.setBounds(new Rectangle(202, 106, 145, 27));
		}
		return txtName;
	}

}
